
//include template: 'template.groovy'

def carsTemplate = '''
//xmlDeclaration()
cars {
   cars.each {
       car(make: it.make, model: it.model){
           engine(model: it.model)


       }
   }
}
'''

def productsTemplate='''
   products{


   }

'''

class Car {
    String make, model
}
def model = [
        cars: [
                new Car(make: 'Peugeot', model: '508'),
                new Car(make: 'Toyota', model: 'Prius')
        ]
]


//def render(xmlTemplate, model) {
//    MarkupTemplateEngine engine =
//        new MarkupTemplateEngine(
//                new TemplateConfiguration( autoNewLine: true, autoIndent: true ) )
//    Template template = engine.createTemplate( xmlTemplate )
//    Writable output = template.make( model )
//    def writer = new StringWriter()
//    output.writeTo( writer )
//    println writer
//}
//
//render( carsTemplate, model )
